package com.mall.user.dto;

import com.mall.commons.result.AbstractRequest;
import com.mall.commons.tool.exception.ValidateException;
import com.mall.user.constants.SysRetCodeConstants;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import javax.xml.bind.ValidationException;

/**
 * @program: cs-mall_35th
 * @description: 插入用户信息
 * @author: Weiwei Liu
 * @create: 2021-12-12 11:52
 **/
@Data
public class InsertMemberRequest extends AbstractRequest {

    private String email;
    private String username;
    private String password;
    private String uuid;

    @Override
    public void requestCheck() {

        if (email == null || username == null || password == null || uuid == null) {
            // 用户注册信息不合法
            throw new ValidateException(
                    SysRetCodeConstants.USER_INFOR_INVALID.getCode(),
                    SysRetCodeConstants.USER_INFOR_INVALID.getMessage());
        }

    }
}
